#include <iostream>
#include <string.h>
#include <unistd.h>
using namespace std;

int main()
{
    while (1)
    {
        /* 获取当前进程id */
        pid_t pid = getpid();
        cout << "pid:" << pid << endl;

        /* 获取当前进程的父进程的id */
        pid_t ppid = getppid();
        cout << "ppid:" << ppid << endl;

        while(1)
        {
            sleep(3);
        }


        


        cout << "hello world" << endl;
        sleep(3);
    }
}

